import request from '@/utils/request'

export const HouseInfoByUserId = (page, size) => {
  return request({
    url: '/business/houseInfo/listById',
    method: 'GET',
    params: {
      page, size
    }
  })
}

export const getHouseInfoListPage = (page, size) => {
  return request({
    url: '/business/houseInfo/list',
    method: 'GET',
    params: {
      page, size
    }
  })
}

export const searchHouseInfoListPage = (searchForm, page, size) => {
  return request({
    url: '/business/houseInfo/search',
    method: 'POST',
    params: {
      page, size
    },
    data: searchForm
  })
}
export const deleteHouseInfo = (id) => {
  return request({
    url: `/business/houseInfo/delete/${id}`,
    method: 'DELETE'
  })
}

export const getHouseInfoById = (id) => {
  return request({
    url: '/business/houseInfo/' + id,
    method: 'GET'
  })
}

export const addHouseInfo = (houseForm) => {
  return request({
    url: '/business/houseInfo/add',
    method: 'POST',
    data: houseForm
  })
}

export const editHouseInfo = (houseForm, id) => {
  return request({
    url: '/business/houseInfo/edit/' + id,
    method: 'PUT',
    data: houseForm
  })
}

export const updateStatusSuccess = (id) => {
  return request({
    url: `/business/houseInfo/examineSuccess/${id}`,
    method: 'POST',
  })
}
export const updateStatusFail = (houseForm,id) => {
  return request({
    url: `/business/houseInfo/examineFail/${id}`,
    method: 'POST',
    data: houseForm
  })
}

